package fantasy;

import java.io.IOException;

import javax.jdo.PersistenceManager;
import javax.jdo.Query;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class PurgeLeaguesServlet extends HttpServlet {

	
	/**
	 * 
	 */
	private static final long serialVersionUID = -2878473267930753473L;

	protected void service(HttpServletRequest req, HttpServletResponse resp)
	throws ServletException, IOException {

		PersistenceManager pm = PMF.get().getPersistenceManager();
		
	    Query query = pm.newQuery(LeagueSettings.class);
	    
		
        try {
            query.deletePersistentAll();
        } finally {
        	log("Deleted All LeagueSettings successfully");
            pm.close();
        }

	}

}
